package com.teach.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.teach.dto.NewsSearchDTO;
import com.teach.entity.News;

public interface NewsMapper {
    int deleteByPrimaryKey(String newsId);

    int insert(News record);

    int insertSelective(News record);

    News selectByPrimaryKey(String newsId);

    int updateByPrimaryKeySelective(News record);

    int updateByPrimaryKeyWithBLOBs(News record);

    int updateByPrimaryKey(News record);
    
    @Select("select count(*) as c from news")
    long count();
    
    @Select("select * from news order by news_time desc limit #{index},#{rowMax}")
    List<News> selectAll(@Param("index")int index,@Param("rowMax")int rowMax);
    
    List<News> select();
    
    List<News> selectMore(NewsSearchDTO search);
}